package com.yilin.tms.core.entity.data.document;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yilin.tms.core.commons.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * 帮助文档目录实体类
 *
 * @author zhangjinyuan
 * @date 2023/08/07  10:43
 */
@Entity
@Table(name = "data_document")
@TableName("data_document")
public class Document extends BaseEntity {

    //目录名称
    @Column(name = "name")
    private String name;

    //目录类型 true:页面 false:目录
    @Column(name = "type")
    private Boolean type;

    //父目录ID
    @Column(name = "parent_id")
    private String parentId;

    //
    @Column(name = "level")
    private Integer level;

    //文件资源ID
    @Column(name = "resource_id")
    private String resourceId;

    //备注
    @Column(name = "remark")
    private String remark;

    //树形数据
    @Transient
    @TableField(exist = false)
    private List<Document> children;

    //文档资源
    @Transient
    @TableField(exist = false)
    private DocumentResource resource;

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public DocumentResource getResource() {
        return resource;
    }

    public void setResource(DocumentResource resource) {
        this.resource = resource;
    }

    public List<Document> getChildren() {
        return children;
    }

    public void setChildren(List<Document> children) {
        this.children = children;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getType() {
        return type;
    }

    public void setType(Boolean type) {
        this.type = type;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getResourceId() {
        return resourceId;
    }

    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }
}
